<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    //关联数据表
    public $table = 'user';

    //主键
    public $primaryKey = "id";

    //允许批量操作的字段
    public $fillable = ['username','password','tel','status','cate'];

    //不允许批量操作的字段
    public $guarded=[];

    //是否维护crated_at和updated_at字段
    public $timestamps = true;

    //用户关联下线
    public function branch(){
        return $this->belongsToMany('App\Model\BranchTest','user_branchtest','uid','role_id');
    }
}
